<!DOCTYPE html>
<html>
    <head>
        <title>ms-duplex</title>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
        <meta http-equiv="X-UA-Compatible" content="IE=edge" /> 
        <script src="../avalon.js" ></script>
        <script>
            var $ = {
                ajax: function(url, data, callback) {
                    setTimeout(function() {
                        callback(data)
                    }, 600)
                }
            }
            var vmodel = avalon.define({
                $id: "test",
                current: {
                    name: "orign"
                },
                click: function() {
                    $.ajax("url", {name: Math.random().toString(32).substr(4, 10)}, function(data) {
                        vmodel.current.name = data.name
                    })
                }
            })
        </script>
    </head>
    <body>
        <div ms-controller="test">
            <input ms-duplex="current.name">
            <br/>
            <button type="button" ms-click="click">click me</button>
        </div>
    </body>
</html>
